<template>
    <el-dialog v-if="dialogVisible" :close-on-click-modal='false' title="项目人员" :visible.sync="dialogVisible" @close="resetForm()" width="400px">
        <div class="region_list flexbox flexcenter">
            <div class="region_item tab_style" :class='{active:region==1}' @click="region=1">深圳</div>
            <div class="region_item tab_style" :class='{active:region==2}' @click="region=2">杭州</div>
        </div>
        <ul class="member_list" v-if="region==1">
            <template v-if="shenzhen.member">
                <li class="member_item flexbox flexcenter flexbetween" v-for="(item,index) in shenzhen.member" :key="index">
                    <span class="member_name">{{item.nickname}}</span>
                    <div class="flexbox flexcenter">
                        <span class="member_tag" v-if="item.executor==1">执行人</span>
                        <span class="member_tag" v-if="item.pm==1">PM</span>
                        <span class="member_tag" v-if="item.gpm==1">GPM</span>
                    </div>
                </li>
            </template>
            <template v-else>
                <li>
                    <div slot="empty" class="flexbox flexcenter flexcolumn flexjust" style="height:250px">
                        <img src="../../assets/img/null_icon.svg" alt="">
                        <div class="font_13 color_03">暂无数据</div>
                    </div>
                </li>
            </template>
        </ul>
        <template v-else>
            <template v-if="hangzhou">
                <div class="member_item flexbox flexcenter flexbetween">
                    <span class="member_name">素材生产组</span>
                    <span class="member_tag">{{hangzhou.group.name}}</span>
                </div>
                <ul class="member_list">
                    <li class="member_item flexbox flexcenter flexbetween" v-for="(item,index) in hangzhou.member" :key="index">
                        <span class="member_name">{{item.nickname}}</span>
                        <div class="flexbox flexcenter">
                            <span class="member_tag" v-if="item.executor==1">执行人</span>
                            <span class="member_tag" v-if="item.pm==1">PM</span>
                            <span class="member_tag" v-if="item.gpm==1">GPM</span>
                        </div>
                    </li>
                </ul>
            </template>
            <template v-else>
                <li>
                    <div slot="empty" class="flexbox flexcenter flexcolumn flexjust" style="height:250px">
                        <img src="../../assets/img/null_icon.svg" alt="">
                        <div class="font_13 color_03">暂无数据</div>
                    </div>
                </li>
            </template>
        </template>

        <span slot="footer" class="dialog-footer">
            <el-button size="small" type="primary" @click="resetForm()" :loading="loading" class="el-button-width">关 闭</el-button>
        </span>
    </el-dialog>
</template>

<script>
export default {
    name: "",
    data() {
        return {
            loading: false,
            region: 1,
            dialogVisible: false,
            shenzhen: {},
            hangzhou: {},
        };
    },
    created() {},
    methods: {
        //获取人员列表
        async getMemberList(sid) {
            const { data: res } = await this.$http.post(
                "adminapi/project/memberSelect",
                {
                    sid: sid,
                }
            );
            if (res.code !== 200) {
                this.$message.error(res.msg);
                return;
            } else {
                this.shenzhen = res.data.shenzhen;
                this.hangzhou = res.data.hangzhou;
            }
        },

        // 关闭重置表单
        resetForm() {
            this.dialogVisible = false;
            this.region = 1;
            this.shenzhen = {};
            this.hangzhou = {};
        },
    },
    components: {},
};
</script>


<style scoped>
.region_list {
    justify-content: center;
}
.region_item {
    height: 40px;
    line-height: 40px;
    padding: 0 20px;
    font-size: 14px;
    color: #616c85;
    margin-top: -5px;
}
.region_item.active {
    color: #17233d;
}
.member_item {
    height: 48px;
}
.member_name {
    font-size: 14px;
    color: #17233d;
}
.member_tag {
    font-size: 12px;
    color: #4475ff;
    line-height: 18px;
    height: 18px;
    border: 1px solid #4475ff;
    padding: 0 5px;
    border-radius: 2px;
    margin-left: 5px;
}
</style>
